//
//  PaymentCouponTableViewCell.swift
//  LeTu
//
//  Created by g1 on 2024/1/20.
//

import UIKit

class PaymentCouponTableViewCell: BaseTableViewCell {

    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        configUI()
    }
    func setCouponsModel(_ couponsModel: MineCouponsModel) {
        priceLabel.text = "-\(couponsModel.money)"
        promptLabel.text = "已减\(couponsModel.money)"
    }
    
    // MARK: ----- configUI
    func configUI() {
        contentView.addSubview(backView)
        backView.addSubview(titleLabel)
        backView.addSubview(promptLabel)
        backView.addSubview(priceLabel)
        
        backView.snp.makeConstraints { make in
            make.left.equalTo(24)
            make.right.equalTo(-24)
            make.top.bottom.equalToSuperview()
        }
        titleLabel.snp.makeConstraints { make in
            make.left.centerY.equalToSuperview()
        }
        promptLabel.snp.makeConstraints { make in
            make.left.equalTo(titleLabel.snp.right).offset(8)
            make.centerY.equalToSuperview()
        }
        priceLabel.snp.makeConstraints { make in
            make.right.centerY.equalToSuperview()
        }
        
        backgroundColor = .app_white
    }
    
    private lazy var backView = UIView()
    private lazy var titleLabel: UILabel = {
        let titleLabel = UILabel()
        titleLabel.text = "优惠券"
        titleLabel.font = kSetPingFangMedium(15)
        return titleLabel
    }()
    private lazy var promptLabel: UILabel = {
        let promptLabel = UILabel()
        promptLabel.font = kSetPingFangRegular(12)
        promptLabel.textColor = .app_promptTextColor
        return promptLabel
    }()
    private lazy var priceLabel: UILabel = {
        let priceLabel = UILabel()
        priceLabel.font = kSetPingFangBlod(20)
        priceLabel.textColor = .app_priceTextColor
        priceLabel.textAlignment = .right
        return priceLabel
    }()
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
